<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>锚点和定位练习</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            body,
            html {
                height: 100%;
            }
            ul{
                width: 60px;
                height: 200px;
                position: fixed;
                right: 100px;
                top: 50%;
                background: white;
                margin-top: -100px;
            }
            li{
                list-style: none;
                height: 40px;
                width: 60px;
                text-align: center;
                position: relative;
                line-height: 40px;
            }
            li:hover{
                background: green;
            }
            li a{
                width: 60px;
                height: 40px;
                display: block;
                text-decoration: none;
                color: grey;
            }
            div{
                color: white;
                font-size: 40px;
                height: 100%;
            }
            #live{
                background: url("img/6.jpg");
            }
            #sports{
                background: url("img/2.jpg");
            }
            #cartoon{
                background: url("img/3.jpg");
            }
            #game{
                background: url("img/4.jpg");
            }
            #tv{
                background: url("img/5.jpg");
            }
        </style>
    </head>
    <body>
        <ul>
            <li><a href="#live">直播</a></li>
            <li><a href="#sports">体育</a></li>
            <li><a href="#cartoon">动漫</a></li>
            <li style="background: green;"><a href="#game">游戏</a></li>
            <li><a href="#tv">电视剧</a></li>
        </ul>
        <div id="live">直播</div>
        <div id="sports">体育</div>
        <div id="cartoon">动漫</div>
        <div id="game">游戏</div>
        <div id="tv">电视剧</div>
    </body>
</html>